package com.erp.warehouse.clouderp_warehouse.controller;

import com.erp.warehouse.clouderp_warehouse.client.WarehouseClient;
import com.erp.warehouse.clouderp_warehouse.util.UniqueOrderCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2025/11/3 16:43
 * author: 向远洋
 */
@RequestMapping("/test")
@RestController
public class TestController {
    @Autowired
    UniqueOrderCode codeUtil;
    @Autowired
    WarehouseClient warehouseClient;

    @RequestMapping("/code")
    public void test() throws InterruptedException {
        String companyCode = "CNY001";
        String type = "INBOUND";
        System.out.println(codeUtil.getCode(companyCode, type));
    }

    @RequestMapping("/testNumber")
    public void test1(Integer digit) {
        System.out.println(digit);
    }

    @RequestMapping("/testRemote")
    public void test2() {
        Object allWarehouse = warehouseClient.getAllWarehouse();
        System.out.println(allWarehouse);
//        for (Warehouse warehouse : allWarehouse) {
//            System.out.print(warehouse.getCode());
//            System.out.print(warehouse.getCompanyCode());
//            System.out.println(warehouse.getName());
//        }
    }
}
